package com.fastmms.generate;

public class GenerateIndexData implements Comparable<GenerateIndexData>{
    private long fileNo;
    private long blockIndex;// 块索引
    private long msgStartNo;// 消息开始序号
    private long msgCount;// 块的消息总数


    public long getFileNo() {
        return fileNo;
    }

    public void setFileNo(long fileNo) {
        this.fileNo = fileNo;
    }

    public long getBlockIndex() {
        return blockIndex;
    }

    public void setBlockIndex(long blockIndex) {
        this.blockIndex = blockIndex;
    }

    public long getMsgStartNo() {
        return msgStartNo;
    }

    public void setMsgStartNo(long msgStartNo) {
        this.msgStartNo = msgStartNo;
    }

    public long getMsgCount() {
        return msgCount;
    }

    public void setMsgCount(long msgCount) {
        this.msgCount = msgCount;
    }

    @Override
    public int compareTo(GenerateIndexData o) {
        if( this.fileNo > o.fileNo ){
            return 1;
        }
        if(this.fileNo < o.fileNo){
            return -1;
        }

        if(this.msgStartNo > o.msgStartNo){
            return 1;
        }

        return this.msgStartNo < o.msgStartNo ? -1 : 0;
    }
}
